package com.yanqu.road.entity.activity.feast.data;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.DataStatus;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.activity.feast.pvp.FeastPvpBirthData;

import java.util.*;

/**
 * 房间信息
 */
@FieldTypeAnnotation(tableName = "t_c_feast_pvp_place_data")
public class CrossFeastPvpPlaceData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "层级id", update = true)
    private int placeId;

    @FieldTypeAnnotation(desc = "更新时间")
    private long updateTime;

    /**
     * 出生点信息
     * 不入库
     */
    private List<FeastPvpBirthData> birthDataList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "首次进入的玩家")
    private long firstUser;


    public CrossFeastPvpPlaceData() {

    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public int getPlaceId() {
        return placeId;
    }

    public void setPlaceId(int placeId) {
        if (this.placeId != placeId) {
            this.placeId = placeId;
            setOp(DataStatus.Update);
        }
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        if (this.updateTime != updateTime) {
            this.updateTime = updateTime;
            setOp(DataStatus.Update);
        }
    }


    public List<FeastPvpBirthData> getBirthDataList() {
        return birthDataList;
    }

    public void setBirthDataList(List<FeastPvpBirthData> birthDataList) {
        this.birthDataList = birthDataList;
    }

    public long getFirstUser() {
        return firstUser;
    }

    public void setFirstUser(long firstUser) {
        if(this.firstUser != firstUser) {
            this.firstUser = firstUser;
            setUpdateOption();
        }
    }

    /**
     * 清除内存无用的数据
     */
    public void clearData() {
        birthDataList.clear();
        firstUser = 0;
    }
}
